NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used in electronic device for mass storage. For example, consumer electronics such as portable media players, often include NAND flash memory to store music, videos, and other media programs. A NVM may store such data using single-level cells (“SLC”), where each memory cell of the NVM can store one of two bit values, or multi-level cells (“MLC”), where each memory cell can store one of four or more bit strings.
When an electronic device is being powered up or rebooted, an operating system can be booted up from a NVM of the electronic device. The bootup of the operating system can proceed in multiple stages. For example, the electronic device can be configured to first execute code from a mask read-only memory (“ROM”). The code can include instructions to load a bootloader, such as a first stage bootloader, from a flash memory to a volatile memory. The task of booting up a second stage bootloader and/or the kernel and operating system of the electronic device may then be transferred from the mask ROM code to the first stage bootloader. The successful completion of this bootup procedure is typically critical for the electronic device to function properly.